package com.zone.domain.strategy.service.raffle.impl;

import com.zone.domain.strategy.model.valobj.AwardStockSubTaskVO;
import com.zone.domain.strategy.repository.IStrategyRepository;
import com.zone.domain.strategy.service.IRaffleStock;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author: zongzi
 * @description: 抽奖库存相关操作
 * @date: 2024/9/23
 */
@Slf4j
@Service
public class RaffleStock implements IRaffleStock {
    @Autowired
    private IStrategyRepository strategyRepository;

    @Override
    public boolean descAwardStock(Long strategyId, Integer awardId) {
        return strategyRepository.descAwardStock(strategyId, awardId);
    }

    @Override
    public void offerAwardStockSubTask(AwardStockSubTaskVO subTask) {
        strategyRepository.offerAwardStockSubTask(subTask);
    }

    @Override
    public AwardStockSubTaskVO pollAwardStockSubTask() {
        return strategyRepository.pollAwardStockSubTask();
    }
}
